package com.card.entity.system;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.NotBlank;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * ClassName: Card <br/>
 * Function: 银行卡. <br/>
 * date: 2018年12月14日 下午5:44:54 <br/>
 * 
 * @author lishuai11
 * @version
 * @since JDK 1.8
 */
@ApiModel
@Entity
@Table(name = "`CARD`")
@EntityListeners(AuditingEntityListener.class)
public class Card implements Serializable{

	private static final long serialVersionUID = 6860818854044430402L;

	public Card(){
		
	}
	
	public Card(String cardName, String cardCode, String cardImage, String cardDetail, int cardScore) {
		this.cardName = cardName;
		this.cardCode = cardCode;
		this.cardImage = cardImage;
		this.cardDetail = cardDetail;
		this.cardScore = cardScore;
	}

	@ApiModelProperty(hidden = true)
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "`CARD_ID`")
	private int cardId;

	@ApiModelProperty(name = "cardName", value = "银行卡名称", dataType = "String", required = true)
	@NotBlank(message = "银行卡名称不为空")
	@Column(name = "`CARD_NAME`", nullable = false, unique = true)
	private String cardName;

	@ApiModelProperty(name = "cardCode", value = "银行卡编码", dataType = "String", notes = "", required = true)
	@NotBlank(message = "银行卡编码不为空")
	@Column(name = "`CARD_CODE`", nullable = false, unique = true)
	private String cardCode;

	@ApiModelProperty(name = "cardImage", value = "银行卡图片", dataType = "String", required = true)
	@NotBlank(message = "图片不为空")
	@Column(name = "`CARD_IMAGE`", nullable = false)
	private String cardImage;

	@ApiModelProperty(name = "cardDetail", value = "银行卡描述", dataType = "String", required = true)
	@NotBlank(message = "描述不为空")
	@Column(name = "`CARD_DETAIL`", columnDefinition = "TEXT", nullable = false)
	private String cardDetail;

	@ApiModelProperty(name = "cardScore", value = "银行卡对应积分", dataType = "int", notes = "银行卡对应积分", required = true)
	@NotNull(message = "银行卡积分不为空")
	@Column(name = "`CARD_SCORE`", nullable = false)
	private int cardScore;

	/**
	 * @return the cardId
	 */
	public int getCardId() {
		return cardId;
	}

	/**
	 * @param cardId the cardId to set
	 */
	public void setCardId(int cardId) {
		this.cardId = cardId;
	}

	/**
	 * @return the cardName
	 */
	public String getCardName() {
		return cardName;
	}

	/**
	 * @param cardName the cardName to set
	 */
	public void setCardName(String cardName) {
		this.cardName = cardName;
	}

	/**
	 * @return the cardCode
	 */
	public String getCardCode() {
		return cardCode;
	}

	/**
	 * @param cardCode the cardCode to set
	 */
	public void setCardCode(String cardCode) {
		this.cardCode = cardCode;
	}

	/**
	 * @return the cardImage
	 */
	public String getCardImage() {
		return cardImage;
	}

	/**
	 * @param cardImage the cardImage to set
	 */
	public void setCardImage(String cardImage) {
		this.cardImage = cardImage;
	}

	/**
	 * @return the cardDetail
	 */
	public String getCardDetail() {
		return cardDetail;
	}

	/**
	 * @param cardDetail the cardDetail to set
	 */
	public void setCardDetail(String cardDetail) {
		this.cardDetail = cardDetail;
	}

	/**
	 * @return the cardScore
	 */
	public int getCardScore() {
		return cardScore;
	}

	/**
	 * @param cardScore the cardScore to set
	 */
	public void setCardScore(int cardScore) {
		this.cardScore = cardScore;
	}

}
